Phase D: add CTBase.Differentiation submodule + DI extension (0.24) - #465
Merged
Conversation
AD backend strategy layer built on CTBase.Strategies: AbstractADBackend + DifferentiationInterface concrete strategy, with the differentiation methods (gradient, derivative, differentiate, pushforward, hamiltonian_gradient, variable_gradient) provided by the CTBaseDifferentiationInterface extension. - ADTypes becomes a hard dependency (default backend AutoForwardDiff). - DifferentiationInterface added as weakdep + extension. - __ad_backend default moved here from CTFlows.Common. - Version bumped to 0.24.0-beta; weakdeps mirrored into [extras]. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Strategy-style guide (based on the Options/Strategies guides), api_reference entry for the module + the CTBaseDifferentiationInterface extension, and the make.jl page. Docs env gains ADTypes/DifferentiationInterface/ForwardDiff for runnable examples. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…rivative tests Docstrings: - AbstractADBackend: replace stale "two methods" note with the full contract - Differentiation module: list ad_backend among the contract methods - DifferentiationInterface ctor: document the mode kwarg and ad_backend aliases Docs: - differentiation.md: clarify ad_backend (core) vs the extension primitives - index.md / getting-started.md: list Options, Strategies, Orchestration, Differentiation, Interpolation submodules and the DI extension Tests: - cover Differentiation.gradient/derivative (real computation via DI extension) - add NotImplemented stub-error tests for gradient/derivative Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase D — Differentiation moves into CTBase
Moves the AD-backend strategy layer from CTFlows into CTBase so the whole
ecosystem can share a single AD abstraction.
What's added
CTBase.Differentiationsubmodule:AbstractADBackend(strategy family)DifferentiationInterfaceconcrete strategy,build_ad_backend,ad_backend,and the contract methods
gradient/derivative/differentiate/pushforward/hamiltonian_gradient/variable_gradient.CTBaseDifferentiationInterfacepackage extension implementing the contractvia DifferentiationInterface.jl (anonymous-closure / ForwardDiff tag-ordering
logic preserved verbatim).
__ad_backend()default (AutoForwardDiff) moved here fromCTFlows.Common.Manifest
1).0.7).[extras]for test-env robustness.Tests & docs
test/suite/differentiation/(ad_backend, arg_placement, module) +extensions/test_differentiation_interface_extension.jl. Full suite green (3981).guide/differentiation.md(strategy-style), api_reference entry + extension,make.jl page; docs build green.
Part of the CTFlows→CTBase move (paired with CTModels compat widening and CTFlows #).
🤖 Generated with Claude Code